import cv2 as cv
import numpy as np




if __name__ == '__main__':
    window=cv.namedWindow("win")
    img=cv.imread("./java.jpg")
    shape=img.shape
    cv.imshow("win",img)
    print("图片的shape：{0}".format(shape))
    print("喜羊羊图片的像素点是：")
    b,g,r=cv.split(img)
    print(img[:,:,:])
    print("r通道的像素值为：",r)

    newImg=cv.bitwise_not(img)
    cv.imshow("new",newImg)
    npImg=np.ones((200,200),dtype=np.uint32)

    print("npImg is:{0}".format(npImg))

    x = np.array([[1, 2], [3, 4], [5, 6]])
    y = x[[0, 1, 2], [0, 1, 0]]
    print(y)
    z=x[[[2,1],[0,1]],[[0,0],[1,0]]]
    print(z)
    cv.waitKey(0)
    cv.destroyAllWindows()